#include "ALLMenu.h"
#include "Show.h"

OptionMenu::OptionMenu(IMenu *FM) {
	FatherMenu = FM;
	Name.push_back("Back");
	Name.push_back("Set Volume");
	Name.push_back("Set Resolution");
	NextMenu = new IMenu*[item];
	NextMenu[0] = FatherMenu;
	NextMenu[1] = new SetVolumeMenu(this);
	NextMenu[2] = new SetResolutionMenu(this);
}

OptionMenu::~OptionMenu() {
	delete NextMenu[1];
	delete NextMenu[2];
	delete[] NextMenu;
}

bool OptionMenu::process() {
	int opt = -1;
	while(opt == -1) {
		Show show(this);
		show.Display();
		Choose chs;
		opt = chs.Option(this);
	}
	MenuMgr::getInstance().SetActiveMenu(NextMenu[opt]);
	return !OVER;
}

std::string OptionMenu::GetChildName(int k) {
	return Name[k];
}

int OptionMenu::GetItem() {
	return item;
}

std::string OptionMenu::GetMyName() {
	return Myname;
}

